<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../../common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>   
    <title>用户List</title>
    <script type="text/javascript">
         function del(){
			 if(!window.confirm('是否要删除数据?? '+ '\n' + '注意数据删除后将无法恢复'))
				return false;
		 }
    </script>
  </head>
  <body>
  
    <c:if test="${!empty msg}">
 	  <script type="text/javascript">
        alert("${msg}");
     </script>
    </c:if>
     <a href="${ctx}/view/account/edit.jsp">添加</a>
    <table border="1">
     <tr><td>ID</td><td>Username</td><td>Password</td><td>UserGroup</td><td>Operation</td></tr>
     <c:if test="${!empty listAccount}">
		<c:forEach items="${listAccount}" var="account" varStatus="status">
			<tr>
				<td>${account.userid}</td>
				<td>${account.username}</td>
				<td>${account.password}</td>
				<td>${account.groupname}</td>
				<td>
					<a href="${ctx }/account.do?cmd=getAccount&userid=${account.userid}">修改</a>
					<a href="${ctx }/account.do?cmd=deleteAccount&userid=${account.userid}" onclick="return del();">删除</a>
				</td>
			</tr>
		</c:forEach>
	</c:if>
	<c:if test="${empty listAccount}">
		<tr><td colspan="5">没有找到相应的记录</td></tr>
	</c:if>
    </table>
  </body>
</html>
